//package com.laoma.usercenter.handler;
//
//
//import com.alibaba.csp.sentinel.slots.block.BlockException;
//import com.laoma.usercenter.common.CommonException;
//import com.laoma.usercenter.common.CommonResponse;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.web.bind.annotation.ExceptionHandler;
//import org.springframework.web.bind.annotation.RestControllerAdvice;
//
///**
// * package: cn.net.wangfujing.partner.web.handler
// * describe: 处理各种异常的页面
// * creat_user: 老马
// * creat_date: 2017/12/15
// * creat_time: 9:27
// * copyright (C) 2016-2036 北京数字王府井科技有限公司.
// **/
//@SuppressWarnings("all")
//@RestControllerAdvice
//@Slf4j
//public class GlobalExceptionHandler {
//
//    //处理自定义的异常
//    @ExceptionHandler(CommonException.class)
//    public CommonResponse commonExceptionHandler(CommonException e) {
//        log.error("全局异常捕获CommonException：{}", e.getMessage());
//        return CommonResponse.buildFailCommonResponse(e.getMessage());
//    }
//    //处理流控异常
//    @ExceptionHandler(BlockException.class)
//    public CommonResponse blockExceptionHandler(BlockException e) {
//        log.error("全局异常捕获BlockException：{}",e.getClass());
//        return CommonResponse.buildFailCommonResponse("服务器繁忙，请稍后重试。");
//    }
//
//    //处理系统异常
//    @ExceptionHandler(Exception.class)
//    public CommonResponse exceptionHandler(Exception e) {
//        log.error("全局异常捕获Exception：{}",e.getMessage());
//        return CommonResponse.buildFailCommonResponse("系统异常");
//    }
//}
